#!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests


def request_index_data(index_number):
    headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36'}
    res = requests.get('https://androidinvest.com/chinaindicespe/' +index_number + "/", headers = headers)
    if res.ok and res.status_code == 200:
        return res.text
    else:
        print("request_index_data error: %s %s %s" % (index_number, res.status_code, res.reason))
        return ""